<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="维修单" name="first"></el-tab-pane>
      <el-tab-pane label="报废单" name="second"></el-tab-pane>
    </el-tabs>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" @click="save" size="mini">保存</el-button>
        <el-button @click="$emit('change','List')" size="mini">返回</el-button>
      </el-col>
    </el-row>
    <template v-if="activeName==='first'">

    </template>
    <el-form v-if="activeName==='second'" ref="form" :rules="rules" :model="form" label-width="110px">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="单据号" prop="q">
            <el-input v-model="form.q" :readonly="isReadOnly" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="设备编号" prop="q">
            <el-input v-model="form.q" :readonly="isReadOnly" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="设备名称" prop="q">
            <el-input v-model="form.q" :readonly="isReadOnly" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="登记日期" prop="q">
            <el-date-picker
              style="width: 100%;"
              :readonly="isReadOnly"
              v-model="form.q"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="所属资源" prop="q">
            <el-input v-model="form.q" :readonly="isReadOnly" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="生产编号" prop="q">
            <el-input v-model="form.q" :readonly="isReadOnly" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="申请日期" prop="q">
            <el-date-picker
              style="width: 100%;"
              :readonly="isReadOnly"
              v-model="form.q"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="使用登记时间" prop="q">
            <el-date-picker
              style="width: 100%;"
              :readonly="isReadOnly"
              v-model="form.q"
              type="date"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="责任部门" prop="q">
            <el-select style="width: 100%;" v-model="form.w" :readonly="isReadOnly" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="使用单位" prop="q">
            <el-select style="width: 100%;" v-model="form.w" :readonly="isReadOnly" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="报废种类" prop="q">
            <el-select style="width: 100%;" v-model="form.w" :readonly="isReadOnly" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="所有权单位" prop="q">
            <el-select style="width: 100%;" v-model="form.w" :readonly="isReadOnly" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="6">
          <el-form-item label="经办人" prop="q">
            <el-select style="width: 100%;" v-model="form.w" :readonly="isReadOnly" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="制单人" prop="q">
            <el-select style="width: 100%;" v-model="form.w" :readonly="isReadOnly" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="报废理由" prop="q">
            <el-input v-model="form.q" :readonly="isReadOnly" />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="备注" prop="q">
            <el-input v-model="form.q" :readonly="isReadOnly" type="textarea" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>

export default {
  data() {
    return {
      // 下拉数据
      options: [],
      // 是否只读
      isReadOnly: false,
      // 表单
      rules: {},
      form: {}
    };
  },
  created() {
    
  },
  methods: {
    save() {
      if (this.activeName==='first') {

      } else {

      }
    }
  }
};
</script>
